//
//  UrlTestViewController.m
//  aTest
//
//  Created by 黄杰 on 15/11/2.
//  Copyright © 2015年 黄杰. All rights reserved.
//

#import "UrlTestViewController.h"

@interface UrlTestViewController ()

@end

@implementation UrlTestViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.title = @"网络测试";
}

/**
 *  点击了网络连接按钮
 */
- (IBAction)didClickUrlConnect:(UIButton *)sender {
    [PTSProgressHUD show];
    [self setupData];
}

/**
 *  请求网络数据
 */
- (void)setupData
{
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    param[@"userId"] = @"8";
    param[@"token"] = @"202cb962ac59075b964b07152d234b70";
    
    NSString *url = @"http://119.147.171.92:8080/zhidian_java/ordersApp/settlement.do";
    
    [PTSManageTool PostWithURL:url parameters:param success:^(id json) {
        
        NSLog(@"%@", json);
        [PTSProgressHUD hide];
        
    } failure:^(PTSError *error) {
        NSLog(@"%@", error.errorString);
    }];
}

@end
